package convert;

import org.apache.commons.beanutils.Converter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author LiangHaiBo
 * @version 1.0
 * @date 2021.8.31 下午 20:12
 */
public class myconvert implements Converter {
    @Override
    public Object convert(Class type, Object obj) {
        try {
            SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd");
            Date date = sdf.parse((String) obj);
            return date;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}
